﻿
Imports System


Namespace $RootNamespace$
    Friend NotInheritable Class Client
        Private Sub New()
        End Sub
        Shared Sub Test()
            ' Create proxy and request a service 
            Dim subject As $ISubject$ = New $Proxy$()
            subject.$Request$()

        End Sub
    End Class
    ' $ISubject$ 
    Friend Interface $ISubject$
        Sub $Request$()
    End Interface


    ' $Proxy$ class
    Friend Class $Proxy$
        Implements $ISubject$
        Private _realSubject As $RealSubject$
        Private Property realSubject() As $RealSubject$
            Get
                If _realSubject Is Nothing Then
                    _realSubject = New $RealSubject$()
                End If
                Return _realSubject
            End Get
            Set(ByVal value As $RealSubject$)
                _realSubject = value
            End Set
        End Property

        Public Sub $Request$() Implements $ISubject$.$Request$
            realSubject.$Request$()
        End Sub
    End Class
    ' $RealSubject$ class
    Friend Class $RealSubject$
        Implements $ISubject$
        Private Shared Sub Test()
            ' Create proxy and request a service 
            Dim proxy As New $Proxy$()
            Proxy.$Request$()


        End Sub
        Public Sub $Request$() Implements $ISubject$.$Request$
            Console.WriteLine("Called " & Me.GetType().ToString() & ".$Request$()")
        End Sub
    End Class
End Namespace
